﻿using UnityEngine;
using System.Collections;

public class WinHandler< T > : GameUIHandler< T > 
{

	public bool showOpenEffect = false;
	public bool showCloseEffect = false;

	public void openEffect()
	{
		if( showOpenEffect )
		{
			TweenPosition tweenAlpha = uiObject.AddComponent<TweenPosition>();
			tweenAlpha.duration = 0.5f;
			tweenAlpha.from = new Vector3(500.0f, 0, 0);
			tweenAlpha.to = new Vector3(0, 0, 0);
			tweenAlpha.PlayForward ();

		}

	}

	public void closeEffect()
	{
		if( showCloseEffect )
		{
			TweenPosition tweenAlpha = uiObject.AddComponent<TweenPosition>();
			tweenAlpha.duration = 0.5f;
			tweenAlpha.from = new Vector3(0, 0, 0);
			tweenAlpha.to = new Vector3(500.0f, 0, 0);
			tweenAlpha.PlayForward ();
			
		}
	}

	new public void Show()
	{
		
		base.Show();
		
		openEffect();
		
	}

	new public void UnShow()
	{
		base.UnShow();

		closeEffect();
	}

	public override void onRelease()
	{
		
	}

	public override void onInit()
	{

	}

	public override void onOpen()
	{

	}

	public override void onClose()
	{
		
	}

}
